﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Microsoft.Windows.Controls.Ribbon;
using DocumentManagement.ViewsModels;


namespace DocumentManagement.Views
{
    /// <summary>
    /// Interaction logic for HomeWindow.xaml
    /// </summary>
    public partial class HomeWindow : RibbonWindow
    {
        public HomeWindow()
        {

            InitializeComponent();

            // Insert code required on object creation below this point.

            PageSwitcher.homeWindow = this;
            PageSwitcher.Switch(new ShowItemDocumentInUserControl());

            //PageSwitcher.PageChanging += (s, e) =>
            //{
            //    if (s.GetType() == typeof(ShowItemDocumentInUserControl))
            //    {
            //        var mr = MessageBox.Show("คุณต้องการจะเปลี่ยนหน้าใช่หรือไม่", "แน่ใจป่าว!", MessageBoxButton.OKCancel);
            //        if (mr == MessageBoxResult.Cancel)
            //            e.Result = false;
            //    }
            //};
        }

        private void DocumentInButton_Click(object sender, RoutedEventArgs e)
        {
            PageSwitcher.Switch(new ShowItemDocumentInUserControl());
        }

        private void DocumentOutButton_Click(object sender, RoutedEventArgs e)
        {
            PageSwitcher.Switch(new ShowItemDocumentOutUserControl());
        }

        private void CreateDocumentButton_Click(object sender, RoutedEventArgs e)
        {
            PageSwitcher.Switch(new ShowItemCreateDocumentUserControl());
        }

        private void CreateDocumentINButton_Click(object sender, RoutedEventArgs e)
        {

        }


        //private void Buttonlogout_Click(object sender, RoutedEventArgs e)
        //{
        //    this.Close();
        //    //LoginWindow loginWin = new LoginWindow();
        //    //loginWin.Show();
        //}

        private void RibbonWindow_Loaded(object sender, RoutedEventArgs e)
        {
           
        }

        private void ReportDocument_Click(object sender, RoutedEventArgs e)
        {
            PageSwitcher.Switch(new OptionReportUserControl());
        }

        private void MenuItemLogOut_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        
    }
}
